package com.oop.InterfaceIsolation;

/**
 * @author Vhong
 * @version 1.0
 */
public class Dog {
    //犬科吃东西
    public void eat(BehaviorOne one) {
        one.hunt();
    }

    //犬科走路
    public void walk(BehaviorTwo two) {
        two.walk();
    }

    //犬科奔跑
    public void run(BehaviorTwo two) {
        two.run();
    }
}

class PetDog implements BehaviorOne, BehaviorTwo {
    private String name;

    public PetDog(String name) {
        this.name = name;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Override
    public void hunt() {
        System.out.println(name + "正在吃东西ing...");
    }

    @Override
    public void walk() {
        System.out.println(name + "正在走路ing...");
    }

    @Override
    public void run() {
        System.out.println(name + "正在奔跑ing...");
    }
}
